package homework;

import java.util.ArrayList;

public class work07 {

	public static void main(String[] args) {
		toBinary(4);
	}

	private static void toBinary(int i) {
		ArrayList<Integer> list = new ArrayList<Integer>();
		if(i==0){
			System.out.println(0);
			return;
		}
		while(i!=0){
			list.add(i%2);
			i /= 2;
		}
		for(int a = list.size()-1;a>=0;a--){
			System.out.print(list.get(a));
		}
	}
	
	
}
